//
//  QKTestObserver.m
//  testTool
//
//  Created by Su on 2018/12/17.
//  Copyright © 2018 com.qiankun. All rights reserved.
//

#import "QKTestObserver.h"
#import "QKTestObject.h"

@implementation QKTestObserver

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
    
    if ([object isKindOfClass:[QKTestObject class]] &&
        [keyPath isEqualToString:@"value"]) {
        
        // 获取value的新值
        NSNumber *valueNum = [change valueForKey:NSKeyValueChangeNewKey];
        NSLog(@"value is %@", valueNum);
    }
}

@end
